import 'package:flutter/material.dart';

import '../common/const/app_color_const.dart';

class Empty extends StatelessWidget {
  final double imgWidth;
  final double imgHeight;
  final String imgSrc;
  final String label;
  final EdgeInsets labelPadding;
  final TextStyle labelStyle;
  final MainAxisAlignment mainAxisAlignment;

  const Empty(
      {Key? key,
      this.imgSrc = "assets/images/empty/default_empty.png",
      this.label = '暂无数据！',
      this.mainAxisAlignment = MainAxisAlignment.center,
      this.labelPadding = const EdgeInsets.only(left: 5),
      this.labelStyle = const TextStyle(color: grayColor, fontSize: 14),
      this.imgWidth = 25,
      this.imgHeight = 25})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: mainAxisAlignment,
      children: [
        Image.asset(
          imgSrc,
          width: imgWidth,
          height: imgHeight,
        ),
        Padding(
          padding: labelPadding,
          child: Text(
            label,
            style: labelStyle,
          ),
        )
      ],
    );
  }
}
